import { Group } from '@/components/pro-panel/index.typing';
import { useStageStore } from '@/store/stage';

const useScale = (): Group => {
  const stageStore = useStageStore();
  return {
    title: '跟随缩放',
    key: 'scale',
    collapsed: false,
    columns: [
      {
        label: '默认常显',
        prop: `geojsonData.features.0.properties.defaultShow`,
        type: 'switch',
        className: 'labelPositionLeft',
        formProps: {
          activeText: '开',
          inactiveText: '关',
          inlinePrompt: true,
        },
      },
      {
        label: '显示距离',
        prop: '',
        type: 'title',
        span: 7,
        visible: !stageStore.layerData.data?.geojsonData?.features?.[0].properties?.defaultShow,
      },
      {
        label: '缩放范围',
        prop: '',
        type: 'title',
        span: 7,
        offset: 1,
        visible: !stageStore.layerData.data?.geojsonData?.features?.[0].properties?.defaultShow,
      },
      {
        label: '缩放比例',
        prop: '',
        type: 'title',
        span: 7,
        offset: 1,
        visible: !stageStore.layerData.data?.geojsonData?.features?.[0].properties?.defaultShow,
      },
      {
        label: '最小距离',
        prop: '',
        type: 'title',
        span: 7,
        visible: !stageStore.layerData.data?.geojsonData?.features?.[0].properties?.defaultShow,
      },
      {
        label: '',
        prop: 'geojsonData.features.0.properties.imageScaleByDistanceArray.0',
        type: 'input-number',
        span: 8,
        formProps: { controls: false, precision: 2, min: 0 },
        visible: !stageStore.layerData.data?.geojsonData?.features?.[0].properties?.defaultShow,
      },
      {
        label: '',
        prop: 'geojsonData.features.0.properties.imageScaleByDistanceArray.1',
        type: 'input-number',
        span: 8,
        formProps: { controls: false, precision: 2, min: 0 },
        visible: !stageStore.layerData.data?.geojsonData?.features?.[0].properties?.defaultShow,
      },
      {
        label: '最大距离',
        prop: '',
        type: 'title',
        span: 7,
        visible: !stageStore.layerData.data?.geojsonData?.features?.[0].properties?.defaultShow,
      },
      {
        label: '',
        prop: 'geojsonData.features.0.properties.imageScaleByDistanceArray.2',
        type: 'input-number',
        span: 8,
        formProps: { controls: false, precision: 2, min: 0 },
        visible: !stageStore.layerData.data?.geojsonData?.features?.[0].properties?.defaultShow,
      },
      {
        label: '',
        prop: 'geojsonData.features.0.properties.imageScaleByDistanceArray.3',
        type: 'input-number',
        span: 8,
        formProps: { controls: false, precision: 2, min: 0 },
        visible: !stageStore.layerData.data?.geojsonData?.features?.[0].properties?.defaultShow,
      },
    ],
  };
};

export default useScale;
